package org.fast.develop.logicflow.ws.thread;

import org.fast.develop.logicflow.runtime.cache.IThreadStore;
import org.fast.develop.logicflow.runtime.cache.ThreadLog;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @author czh
 * @version V1.0
 * @data Created on 2023-01-12 14:43
 */
public class ThreadStore implements IThreadStore {

    private ConcurrentHashMap<String, ThreadLog> threads = new ConcurrentHashMap<>();

    @Override
    public void put(String sessionId, ThreadLog threadLog) {
        threads.put(sessionId, threadLog);
    }

    @Override
    public ThreadLog get(String sessionId) {
        return threads.get(sessionId);
    }

    @Override
    public void remove(String sessionId) {
        threads.remove(sessionId);
    }
}
